package cn.com.sd.log.model;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Proxy;

import cn.com.sd.system.model.Operator;

@Entity
@Table(name="service_log")
@Proxy(lazy = false)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ServiceLog implements java.io.Serializable {

	private static final long serialVersionUID = 7593288725033779736L;

	/* 日志编号*/
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	private Integer id;
	
	/*操作员编号*/
	@ManyToOne(fetch=FetchType.LAZY, targetEntity=Operator.class)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@JoinColumn(name="oper_id")
	private Operator operator;
	
	/*操作员名称*/
	@Column(name = "oper_name")
	private String operName;
	
	/* 证书序列号*/
	@Column(name = "cert_sn")
	private String certSn;
	
	/* 证书主题*/
	@Column(name = "cert_dn")
	private String certDn;
	
	/* 业务名称*/
	@Column(name = "service")
	private String service;
	
	/*业务模块*/
	@Column(name = "module")
	private String module; 
	
	/*操作内容*/
	@Column(name = "content")
	private String content;
	
	/*处理结果*/
	@Column(name = "result")
	private String result;
	
	/*请求方IP地址*/
	@Column(name = "remote_ip")
	private String remoteIp; 
	
	/*请求方端口号*/
	@Column(name = "remote_port")
	private String remotePort; 
	
	/*签名，本条日志关键字段的签名值*/
	@Column(name = "signature")
	private String signature; 
	
	/*签名链*/
	@Column(name = "signature_link")
	private String signatureLink;

	public ServiceLog(){}
	
	public ServiceLog(String service, String module) {
		this.service = service;
		this.module = module;
	}

	public Operator getOperator() {
		return operator;
	}

	public void setOperator(Operator operator) {
		this.operator = operator;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getOperName() {
		return operName;
	}

	public void setOperName(String operName) {
		this.operName = operName;
	}

	public String getCertSn() {
		return certSn;
	}

	public void setCertSn(String certSn) {
		this.certSn = certSn;
	}

	public String getCertDn() {
		return certDn;
	}

	public void setCertDn(String certDn) {
		this.certDn = certDn;
	}

	public String getService() {
		return service;
	}

	public void setService(String service) {
		this.service = service;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getRemoteIp() {
		return remoteIp;
	}

	public void setRemoteIp(String remoteIp) {
		this.remoteIp = remoteIp;
	}

	public String getRemotePort() {
		return remotePort;
	}

	public void setRemotePort(String remotePort) {
		this.remotePort = remotePort;
	}

	public String getSignature() {
		return signature;
	}

	public void setSignature(String signature) {
		this.signature = signature;
	}

	public String getSignatureLink() {
		return signatureLink;
	}

	public void setSignatureLink(String signatureLink) {
		this.signatureLink = signatureLink;
	}
	
	
}
